# Maintainer: Mitch Tishmack <mitch.tishmack@gmail.com>
pkgname=ucl
pkgver=1.03
pkgrel=3
pkgdesc="Portable lossless data compression library written in ANSI C"
url="http://www.oberhumer.com/opensource/ucl/"
arch="all"
license="GPL-2.0"
makedepends="file"
subpackages="$pkgname-dev"
source="http://www.oberhumer.com/opensource/$pkgname/download/$pkgname-$pkgver.tar.gz
	0001-Static-assert.patch
	ucl.pc.in
	"

prepare() {
	default_prepare
	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--prefix=/usr \
		--enable-shared \
		--enable-static
	make
}

check() {
	./examples/simple
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -p "$pkgdir"/usr/lib/pkgconfig/
	sed "s|@PKGVER@|$pkgver|" "$srcdir"/ucl.pc.in > "$pkgdir"/usr/lib/pkgconfig/ucl.pc
}

sha512sums="
7dd1824d01b4bb41ee03bbceddc634a9f7f910d235e5cca163d783680d6743f0f3cc309bbbcc1e094d897d549d3805a555f9093b4d77805443d896dd1862aa34  ucl-1.03.tar.gz
24a34de871fcfa919985afc29c60496b1f0e730550e8387f212a5229f32ccade4178d1221574d86c36d025c08b3b5ed6d236f2b4d740436afe0451ae9050f890  0001-Static-assert.patch
2e60ba8bc11adc65914c998ea874813a658b9ad7ba519968d16bb4ec3180fe705aa73e1a4668c71cb79ed925b16e2393eda0cb97bc1864e0032391d7ac3dbe53  ucl.pc.in
"
